﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ecdl.demo.model.expression {
    public class Not : SingleExpression {

        public Not() {
        }

        public Not(Expression expression) {
            this.Expression = expression;
        }

        public override ExpressionState Evaluate(ExpressionContext context) {
            ExpressionState childState = Expression.Evaluate(context);
            return new NotExpressionState(this, childState);
        }
    }

    public class NotDTO : SingleExpressionDTO {

        public NotDTO() : base(typeof(Not)) {

        }

        public NotDTO(ExpressionDTO dto) : this(){
            Expression = dto;
        }
    }
}
